<template>
    <div>
        <headerText :title="'消息' + notice"></headerText>
        <div class="content">
            <div class="main_information">
                <div class="main_information_top"></div>
                <div class="main_informatino_bottom">
                    <div class="main_info_list">
                        <ul>
                            <li @click="handClick('circlenews')" :class="{'active':'circlenews'===targetFlag}">
                                <i class="iconfont icon-youquanlogozhuanhuan"></i>
                                <span>圈子消息</span>
                            </li>
                            <li @click="handClick('companynews')" :class="{'active':'companynews'===targetFlag}">
                                <i class="iconfont icon-qiye1"></i>
                                <span>企业消息</span>
                            </li>
                            <li @click="handClick('friendnews')" :class="{'active':'friendnews'===targetFlag}">
                                <i class="iconfont icon-xiaoxi5"></i>
                                <span>好友消息</span>
                            </li>
                            <li @click="handClick('systemnews')" :class="{'active':'systemnews'===targetFlag}">
                                <i class="iconfont icon-xiaoxi2"></i>
                                <span>系统消息</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <!-- 渲染信息列表 -->
            <div v-if="targetFlag==='circlenews'" style="margin-top: 2.24rem;">
                <div class="info_lists">
                    <div class="info_item_left">
                        <img src="../common/images/userAvatar.png" alt="">
                    </div>
                    <div class="info_item_desc">
                        <h5>广东中山电子有限公司</h5>
                        <p>耐思智慧得到餐饮耐思智慧饮耐思智有限公司</p>
                    </div>
                    <div class="info_item_gray">
                        <span>下午 5:30</span>
                    </div>
                </div>
            </div>
            <div v-if="targetFlag==='companynews'" style="margin-top: 2.24rem;">
                <div class="info_lists">
                    <div class="info_item_left">
                        <img src="../common/images/userAvatar.png" alt="">
                    </div>
                    <div class="info_item_desc">
                        <h5>广东中山电子有限公司</h5>
                        <p>耐思智慧得到餐饮耐思智慧饮耐思智有限公司</p>
                    </div>
                    <div class="info_item_gray">
                        <span>下午 5:30</span>
                    </div>
                </div>
            </div>
            <div v-if="targetFlag==='friendnews'" style="margin-top: 2.24rem;">
                <div class="info_lists">
                    <div class="info_item_left">
                        <img src="../common/images/userAvatar.png" alt="">
                    </div>
                    <div class="info_item_desc">
                        <h5>广东中山电子有限公司</h5>
                        <p>耐思智慧得到餐饮耐思智慧饮耐思智有限公司</p>
                    </div>
                    <div class="info_item_gray">
                        <span>下午 5:30</span>
                    </div>
                </div>
            </div>
            <div v-if="targetFlag==='systemnews'" style="margin-top: 2.24rem;">
                <div class="info_lists">
                    <div class="info_item_left">
                        <img src="../common/images/userAvatar.png" alt="">
                    </div>
                    <div class="info_item_desc">
                        <h5>广东中山电子有限公司</h5>
                        <p>耐思智慧得到餐饮耐思智慧饮耐思智有限公司</p>
                    </div>
                    <div class="info_item_gray">
                        <span>下午 5:30</span>
                    </div>
                </div>
            </div>
        </div>
	  	<so-footer></so-footer>
    </div>
</template>

<script>
import headerText from '../public/header-text.vue';
import soFooter from '../components/footer-bar';
    export default {
        data() {
            return {
                notice: '(共有16条消息)',
                targetFlag: 'circlenews',
            }
        },
        methods: {
            // 切换消息列表
            handClick(flag) {
                this.targetFlag = flag;
            },
        },
        components: {
            headerText,
            soFooter
        }
    }
</script>

<style>
/* 顶部浮层 */
.main_information {
    height: 2.2rem;
    position: fixed;
    width: 100%;
    overflow: hidden;
    z-index: 10;
}
.main_information .main_information_top {
    width: 100%;
    height: 0.88rem;
    padding: 0;
    background-color: #E50834;
    position: absolute;
    top: 0;
    left: 0;
}
.main_information .main_informatino_bottom {
    position: absolute;
    height: 2rem;
    width: 7.1rem;
    left: 50%;
    -webkit-transform: translate(-50%);
    transform: translate(-50%);
    background-color: #fff;
    border-radius: 0.08rem;
    box-shadow: 0 2px 3px -1px #f3ecec;
    z-index: 10;
}
.main_informatino_bottom .main_info_list ul{
    margin-top: 0.32rem;
    display: flex;
    justify-content: space-between;
}
.main_informatino_bottom .main_info_list ul>li {
    flex: 1;
    text-align: center;
    width: 1.775rem;
}
.main_info_list ul>li .icon-youquanlogozhuanhuan {
    width: 0.84rem;
    height: 0.84rem;
    font-size: 0.5rem;
    display: block;
    margin: 0 auto;
    background-color: #e50838;
    border-radius: 18px;
    color: #fff;
    line-height: 0.84rem;
    text-align: center;
    margin-bottom: 0.2rem;
}
.main_info_list ul>li .icon-qiye1 {
    width: 0.84rem;
    height: 0.84rem;
    font-size: 0.5rem;
    display: block;
    margin: 0 auto;
    background-color: #42D0FF;
    border-radius: 18px;
    color: #fff;
    line-height: 0.84rem;
    text-align: center;
    margin-bottom: 0.2rem;
}
.main_info_list ul>li .icon-xiaoxi5 {
    width: 0.84rem;
    height: 0.84rem;
    font-size: 0.5rem;
    display: block;
    margin: 0 auto;
    background-color: #9BDF38;
    border-radius: 18px;
    color: #fff;
    line-height: 0.84rem;
    text-align: center;
    margin-bottom: 0.2rem;
}
.main_info_list ul>li .icon-xiaoxi2 {
    width: 0.84rem;
    height: 0.84rem;
    font-size: 0.5rem;
    display: block;
    margin: 0 auto;
    background-color: #FFC63D;
    border-radius: 18px;
    color: #fff;
    line-height: 0.84rem;
    text-align: center;
    margin-bottom: 0.2rem;
}
.main_info_list ul>li span {
    font-size: 0.26rem;
    color: #333;
    font-weight: 400;
    display: block;
}

/* 信息列表--圈子消息 */
.info_lists {
    display: flex;
    justify-content: space-between;
    table-layout: fixed;
    height: 1.48rem;
    line-height: 1.48rem;
    border-bottom: 1px solid #d8d8d8;
}
.info_lists .info_item_left {
    width: 1rem;
    height: 1rem;
    margin: auto;
}
.info_item_left img {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    vertical-align: super;
}
.info_lists .info_item_desc {
    margin: auto;
    width: 4.2rem;
    text-align: left;
}
.info_item_desc h5 {
    font-size: 0.28rem;
    color: #333;
    line-height: 0.48rem;
    height: 0.48rem;
}
.info_item_desc p {
    font-size: 0.24rem;
    color: #666;
    padding-bottom: 0;
    background-color: transparent;
    width: 4.2rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
    overflow: hidden;
    height: 0.48rem;
    line-height: 0.48rem;
}
.info_lists .info_item_gray {
    margin: auto;
    margin-top: -0.3rem;
    font-size: 0.24rem;
    color: #999;
}
</style>